package org.iac;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.KeyEvent;
import android.view.Window;
import android.view.WindowManager;

public class Main extends Activity {
	
	public boolean isBackPressed = false;

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setFullscreen();
		setContentView(R.layout.main);
	}

	public void setFullscreen() {
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		
		new Handler().postDelayed(new Runnable() {
			
			public void run() {
				// TODO Auto-generated method stub

				final Intent mainIntent = new Intent(Main.this,
						DashboardActivity.class);
				startActivityForResult(mainIntent, 1);
				finish();
				
			}
		}, 5000);
	}
	
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_BACK) {
			finish();
			isBackPressed = true;

			return true;
		}
		return super.onKeyDown(keyCode, event);
	}
}
